package cn.内存分配.pojo;

import java.util.Objects;

public class Block {
    private String name;    //名字
    private Integer size;   //大小
    private Integer initialAddress;//进程的起始地址
    private String status;  //状态

    public Block() {
    }

    public Block(String name, Integer size, Integer initialAddress, String status) {
        this.name = name;
        this.size = size;
        this.initialAddress = initialAddress;
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getInitialAddress() {
        return initialAddress;
    }

    public void setInitialAddress(Integer initialAddress) {
        this.initialAddress = initialAddress;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Block block = (Block) o;
        return Objects.equals(name, block.name) && Objects.equals(size, block.size) && Objects.equals(initialAddress, block.initialAddress) && Objects.equals(status, block.status);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, size, initialAddress, status);
    }

    @Override
    public String toString() {
        return "Block{" +
                "name='" + name + '\'' +
                ", size=" + size +
                ", initialAddress=" + initialAddress +
                ", status='" + status + '\'' +
                '}';
    }
}
